#pragma once
#include <vector>

typedef struct tagFileInfo
{
	CString		strFileName;
	CString		strMd5;
	CString		strRatPath;

	tagFileInfo& operator = (const tagFileInfo& stFileInfo)
	{
		strFileName = stFileInfo.strFileName;
		strMd5 = stFileInfo.strMd5;
		strRatPath = stFileInfo.strRatPath;
		return *this;
	}

	bool operator < (const tagFileInfo& stFileInfo)
	{
		return strRatPath.CompareNoCase(stFileInfo.strRatPath) < 0;
	}
}FileInfo, *PFileInfo;
typedef std::vector<FileInfo>	VCT_FILE_INFO;

class CGeneDirMd5
{
public:
	CGeneDirMd5(void);
	~CGeneDirMd5(void);

public:
	void	GeneAllFileMd5(CString strDirPath, CString strRalPath);
	void	ResetContent();
	void	GetResult(VCT_FILE_INFO& vctFileInfo);

private:
	void	CalcFileMd5(CString strFileName);
	CString Md5ToCString(const byte* pMd5);

private:
	VCT_FILE_INFO		m_vctFileInfo;
};
